<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"      
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:ezcomp="http://java.sun.com/jsf/composite/ezcomp">
    <h:head>
        <title>Usuários</title>
        <h:outputStylesheet name="css/default.css"/>        
    </h:head>

    <h:body>
        <ui:composition template="default_layout_with_menu.xhtml">            
            <ui:define name="titulo-pagina">Usuários</ui:define>
            <ui:define name="content">
                <p:messages />
                <p:commandButton ajax="false" value="Novo" action="#{userJsfBean.criarObj}" image="novo"/>
                <p:commandButton ajax="true" value="Atualizar listagem" action="#{userJsfBean.atualizar}" update="tabela1" image="atualizar"/>
                <p:dataTable id="tabela1" value="#{userJsfBean.usuarios}" var="item"
                             emptyMessage="Nenhum registro cadastrado." >
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Id"/>
                        </f:facet>
                        <h:outputText value="#{item.id}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Login"/>
                        </f:facet>
                        <h:outputText value="#{item.login}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Nome"/>
                        </f:facet>
                        <h:outputText value="#{item.nome}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Ações"/>
                        </f:facet>
                        <ezcomp:imgActionDatatable bean="#{userJsfBean}" tipo="edit"/>
                        <ezcomp:imgActionDatatable bean="#{userJsfBean}" tipo="del"/>
                    </p:column>
                </p:dataTable>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

